package cn.edu.nju.software.dao.intf;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import cn.edu.nju.software.bean.show.CommentSearchListItem;
import cn.edu.nju.software.bean.storage.Comment;

public interface CommentDao {

	public abstract List<CommentSearchListItem> getAllComments() throws SQLException;
	
	/** This method searches for comments according to the provided criteria.
	 * 
	 * @param criteria
	 * @return
	 * @throws SQLException
	 */
	public abstract List<CommentSearchListItem> searchComments(
			Map<Integer, Object> criteria) throws SQLException;

	public abstract List<Comment> getCommentByUserId(int userID)
			throws SQLException;

	public abstract int postComment(Comment comment) throws SQLException;

	/**
	 * This method updates the sticky status of the specified comment.
	 * 
	 * @param comment
	 * @throws SQLException
	 */
	public abstract void updateComment(Comment comment) throws SQLException;

	/**
	 * The returned list has been sorted by the database.
	 * 
	 * @param bookID
	 * @return
	 * @throws SQLException
	 */
	public abstract List<CommentSearchListItem> getCommentByBookID(int bookID)
			throws SQLException;
}
